<include file="Public:header"/>	
		
		<div id="content">
			<div id="content-header">
				<h1>图片列表</h1>
				<div class="btn-group">
					<a href="{:U('Admin/Picture/index')}" class="btn" title="新增图片"><i class="fa fa-file"></i></a>
					<a class="btn" title="相册评论"><i class="fa fa-comment"></i></a>
				</div>
			</div>
			<div id="breadcrumb">
				<a href="#" title="回到首页" class="tip-bottom"><i class="fa fa-home"></i> 首页</a>
				<a href="#">图片管理</a>
				<a href="#" class="current">图片列表</a>
			</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="widget-box">
							<div class="widget-title">
								<span class="icon">
									<i class="fa fa-picture-o"></i>
								</span>
								<h5>图片列表</h5>
							</div>
							<div class="widget-content">
								<div class="gallery-masonry">
									<volist name="List" id="v">
                                    <div class="item">
										<a href="#" class="thumbnail">
											<img src="{$v.p_thumb}">
										</a>
										<div class="actions">
											<div class="actions-inner">
												<a  href="{:U('/Admin/Picture/pictureEdit',array('id'=>$v['p_id']))}" class="tip-top"><i class="fa fa-pencil"></i></a>
												<div id="img" style="display: none;">{$v.p_id}</div>
												<a class="tip-top delP"><i class="fa fa-trash-o"></i></a>
											</div>
										</div>
								    </div>
								  	</volist> 
                                </div>
							</div>
						</div>
                        
					</div>
				</div>
		</div>
<include file="Public:footer"/> 
<script src="__JS__/jquery.masonry.min.js"></script>

            <script>
                $(function(){
                    $('.gallery-masonry').masonry({
                      itemSelector: '.item',
                      isAnimated: true,
                      isFitWidth: true
                    });
                    $('.delP').click(function(){
                    	$(".delP").attr("disabled",true);
						var id = $(this).prev("#img").text();
                    	//console.log(id);
	            		$.ajax({
	            			type:"post",
	            			url:"/Admin/Picture/pictureDel",
	            			async:true,
	            			data:{"id":id},
	            			success:function(data){
	            				if(data.error==0){
	            					succ("完成!",data.msg,"__SELF__");
	            				}else{
	            					err("错误!",data.msg);
	            					$(".delP").removeAttr('disabled');
	            				}
	            			},
	            		});
                    });
                });
            </script>
	</body>
</html>
